<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('demo')) { return; }

        Schema::create('demo', function (Blueprint $table) {
            $table->id();
$table->string('name')->nullable()->comment('name');
$table->string('img')->nullable()->comment('图片地址');
$table->string('file')->nullable()->comment('单文件地址');
$table->text('files')->nullable()->comment('多文件地址');
$table->text('content')->nullable()->comment('富文本');
$table->integer('status')->default(1)->comment('开关按钮，1启用2禁用');
$table->decimal('dec')->default(0)->comment('浮点数');
$table->integer('number')->default(0)->comment('整数');
$table->integer('type')->default(1)->comment('多类型，1类型1，2类型2，3类型3');
$table->dateTime('datetime')->nullable()->comment('时间，年月日时分秒');
$table->integer('year')->nullable()->comment('时间，年');
$table->integer('month')->nullable()->comment('时间，月');
$table->date('date')->nullable()->comment('时间，年月日');
$table->json('json_arr')->nullable()->comment('json格式');
$table->integer('parent_id')->default(0)->comment('父级id');
$table->creatorId();
$table->createdAt();
$table->updatedAt();
$table->deletedAt();

$table->engine='InnoDB';
$table->comment('demo');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('demo');
    }
};
